import { DataSource } from 'typeorm';
import { Yingshishipin } from './entities/yingshishipin.entity';

export const yingshishipinProviders = [
  {
    provide: 'YINGSHISHIPIN_REPOSITORY', // 自定义的仓库令牌
    useFactory: (dataSource: DataSource) =>
      dataSource.getRepository(Yingshishipin), // 获取实体对应的 Repository
    inject: ['DATABASE_CONNECTION'], // 注入数据源
  },
];
